<template>
  <div class="container">
    <van-tabs
      v-model:active="tabIndex"
      sticky
      shrink
      title-inactive-color="#878B97"
      title-active-color="#000"
      color="#000"
      line-width="20px"
      background="#fff"
    >
      <van-tab title="AI智能交易">
        <tab-one ref="tabOnef"></tab-one>
      </van-tab>
      <van-tab title="我的策略">
        <tab-two ref="tabTwof"></tab-two>
      </van-tab>
    </van-tabs>
  </div>
  <!-- <no-register /> -->
</template>
    
<script setup lang='ts'>
import { nextTick, ref, watch } from "vue";
import TabOne from "./components/TabOne.vue";
import TabTwo from "./components/TabTwo.vue";
import NoRegister from "@/components/NoRegister";
const tabIndex = ref(0);
const tabOnef = ref(null);
const tabTwof = ref(null);
watch(
  tabIndex,
  (newVal, oldVal) => {
    nextTick(() => {
      if (newVal === 0) {
        tabOnef.value.getAiList();
      } else {
        // tabTwof.value.getAiList();
      }
    });
  },
  {
    immediate: true,
  }
);
</script>
    
<style lang="scss" scoped>
</style>